import*as e from"../../legacy/theme_support/theme_support.js";import*as t from"../../lit-html/lit-html.js";import*as r from"../../../core/platform/platform.js";import*as o from"../render_coordinator/render_coordinator.js";var n=Object.freeze({__proto__:null,setup:async function(){const t={get:()=>"default"};e.ThemeSupport.instance({forceNew:!0,setting:t})}});var a=Object.freeze({__proto__:null,defineComponent:function(e,t){customElements.get(e)?console.error(`${e} already defined!`):customElements.define(e,t)}});class s extends t.Directive.Directive{constructor(e){if(super(e),e.type!==t.Directive.PartType.ATTRIBUTE)throw new Error("Node rendered callback directive must be used as an attribute.")}update(e,[t]){t(e.element)}render(e){}}const c=t.Directive.directive(s);var d=Object.freeze({__proto__:null,nodeRenderedCallback:c});var i=Object.freeze({__proto__:null,getRootNode:function(e){const t=e.getRootNode();return t.nodeName,t}});const l=o.RenderCoordinator.RenderCoordinator.instance(),u=new WeakSet,p=new WeakSet,f=new WeakMap,_=new WeakMap;var m=Object.freeze({__proto__:null,scheduleRender:async function e(t,r){if(p.has(t))return void f.set(t,r);if(u.has(t))return;u.add(t);let o=_.get(r);if(o||(o=async()=>{u.delete(t),p.add(t);try{await r.call(t)}catch(e){throw console.error(`ScheduledRender: rendering ${t.nodeName.toLowerCase()}:`),console.error(e),e}finally{p.delete(t)}},_.set(r,o)),await l.write(o),f.has(t)){const r=f.get(t);if(f.delete(t),!r)return;e(t,r)}},isScheduledRender:function(e){return p.has(e)}});var h=Object.freeze({__proto__:null,set:function(e,t,r){e.style.setProperty(t,r)}});export{n as ComponentServerSetup,a as CustomElements,d as Directives,i as GetRootNode,m as ScheduledRender,h as SetCSSProperty};
